import pagesJson from '@/pages.json'

export default {
	data(){
		return {
			shareTitle: null,
			sharethumb: ''
		}
	},
	onShareAppMessage() { //发送给朋友
	   return {
		title: this.shareTitle,
		imageUrl: this.sharethumb,
	   }
	},
	onShareTimeline() { //分享到朋友圈
	   return {
		title: this.shareTitle,
		imageUrl: this.sharethumb,
	   }
	},
	mounted(){
		// const pages = getCurrentPages()
		// const page = pages[pages.length - 1]
		// const fullPath = page.$page.fullPath
		// const pageList = pagesJson.pages
		// const pathObj = pageList.find(item => item.path == fullPath)
		// let pageTitle = this.shareTitle
		// if(pathObj){
		// 	pageTitle = pathObj.style.navigationBarTitleText
		// }
		
		let pageTitle = pagesJson.globalStyle.navigationBarTitleText
		
		console.log("pageTitle:",pageTitle)
		this.shareTitle = pageTitle
	}
}